<template>
  <RenderVnodes
    :vnodes="slotName"
  ></RenderVnodes>
</template>

<script lang="ts">
import {ComsCommonMixin} from "../mixins/ComsCommonMixin";

export default {
  name: 'Slot',
  mixins:[ComsCommonMixin],
  computed: {
    slotName(){
      const name = this.item.prop || this.item.slotName
      const $slot = this.tableVm.$slots[name];
      if($slot){
        return $slot({
          ...this.defaultProps,
          tableData: this.tableData
        })
      } else {
        return []
      }
    }
  },
  methods: {
    initValue() {
      this.item.slotInitValue(this.defaultProps.row,this.item)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>